<template>
	<view>
		<view>
			<view class="details">
				<view>申请单位：</view>
				<view class="right">{{detail.applyDept}}</view>
			</view>
			<view class="details">
				<view>申请人：</view>
				<view class="right">{{detail.applyUser}}</view>
			</view>
			<view class="details">
				<view>作业申请时间：</view>
				<view class="right">{{detail.applyTime}}</view>
			</view>
			<view class="details wenjian">
				<view>作业原因：</view>
				<view class="right1">
					<picker @change="because" :range="array">
						<label class="">{{array[index]}}</label>
					</picker>
				</view>
			</view>
			<view class="details area">
				<view>
					作业内容：
					<view class="textarea">{{detail.workContent}}</view>
				</view>
			</view>
			<view class="details area">
				<view>
					动火地点：
					<view class="textarea">{{detail.workPlace}}</view>
				</view>
			</view>
			<view class="details">
				<view>动火作业级别：</view>
				<view class="right">{{detail.workLevel}}</view>
			</view>
			<view class="details area">
				<view>
					动火方式：
					<!-- <textarea placeholder="可能产生火焰、火花或炽热表面的非常规作业，如电焊、气 焊(割)、喷灯、电钻、砂轮等。"></textarea> -->
					<view class="textarea">{{detail.workWay}}</view>
				</view>
			
		</view>
		<view class="shuju" v-for="(item,index) in detail.hotAnalysisList">
				<view class="details">分析数据：</view>
				<view class="details">
					<view>分析时间：</view>
					<view class="right">{{item.analysisTime}}</view>
				</view>
				<view class="details">
					<view>分析部位名称：</view>
					<view class="right">{{item.analysisName}}</view>
				</view>
				<view class="details area">
					<view>
						分析项目：
						<view class="textarea">{{item.analysisProject}}</view>
					</view>
				</view>
				<view class="details">
					<view>分析标准：</view>
					<view class="right">{{item.analysisStandard}}</view>
				</view>
				<view class="details">
					<view>分析数据(%LEL)：</view>
					<view class="right">{{item.analysisData}}</view>
				</view>
				<view class="details">
					<view>分析人：</view>
					<view class="right">{{item.analysisUser}}</view>
				</view>
				<view class="details">
					<view>监护人：</view>
					<view class="right">{{detail.guardUser}}</view>
				</view>
				<view class="details area">
					<view>
						分析结果：
						<view class="image">
							<image src="../../../static/image/end.png"></image>
							<image src="../../../static/image/end.png"></image>
						</view>
					</view>
				</view>
				<view class="details">
					<view>开始时间：</view>
					<view class="right">{{detail.workStartTime}}</view>
				</view>
				<view class="details">
					<view>结束时间：</view>
					<view class="right">{{detail.workEndTime}}</view>
				</view>
				<view class="details">
					<view>动火作业实施时间：</view>
					<view class="right">3</view>
				</view>
				<view class="details">
					<view>动火作业负责人：</view>
					<view class="right">{{detail.workDutyUser}}</view>
				</view>
				<view class="details">
					<view>动火人：</view>
					<view class="right">{{detail.workUser}}</view>
				</view>
				<view class="details area">
					<view>
						涉及其他的特殊作业：
						<view class="textarea">{{detail.relateWorkName}}</view>
					</view>
				</view>
				<view class="details">
					<view> 涉及其他的特殊作业安全作业证编号： </view>
					<view class="right">{{detail.relateWorkNo}}</view>
				</view>
				<view class="details">
					<view> 风险辨识结果： </view>
					<view class="right">{{detail.riskResult}}</view>
				</view>
			</view>
			<view class="shuju">
				<view class="details">安全措施：</view>
				<view class="details area">
					<view >
						安全措施：<text>(更新2020年11月25日)</text>
						<view class="xian" v-for="(item,index) in detail.measureList" :key="index">
							<text class="dian">●</text>
							{{item.measureContent}}
							<view class="image">
								<view v-for="(items,indexs) in item.measureFileList" :key="indexs" style="display: flex;">
									<image :src="items.url"></image>
								</view>
							</view>
						</view>
						
						<!-- <view class="xian">
							<text class="dian">●</text>
							 已对动火作业危险性进行辨识分析，制定安全作业方案，
							明确人员职责及分工，并针对性制定事故应急救援方案（含
							作业人员紧急状况时的逃生路线和救护方法），涉及拆除管
							线的已查明内部介质及其走向，并根据所要拆除管线的情况
							制定安全防火措施。    
						</view>
						<view class="image">
							<image src="../../../static/image/end.png"></image>
							<image src="../../../static/image/end.png"></image>
						</view> -->
						<!-- <view class="xian">
							<text class="dian">●</text>
							现场已设专人进行全过程监护，警戒隔离与安全警示标志 设置到位，与作业无关人员已离开现场。
						</view> -->
					</view>
					
				</view>
				<view class="details area">
					<view>
						其他安全措施
						<view class="xian">
							{{detail.securityMeasures}}
						</view>
					</view>
				</view>
				<!-- <view class="details">
					<view>确认人：</view>
					<view class="right" v-for="(item,index) in detail.measureList" :key="index">
					{{item.confirmUser}}
					<view class="details area">
						<view>
							安全措施附件：
							<view class="image">
								<view v-for="(item,index) in item.measureFileList" :key="index" style="display: flex;">
									<image :src="item.url"></image>
								</view>
							</view>
						</view>
					</view>
					</view>
				</view> -->
				<view class="details area">
					<view >
						<view>确认人：</view>
						<view v-for="(item,index) in detail.measureList" :key="index">
							<view  class="right">{{item.confirmUser}}</view>
							<view class="safeWord">安全措施附件：</view>
							<view class="image">
								<view v-for="(items,indexs) in item.measureFileList" :key="indexs" style="display: flex;">
									<image :src="items.url"></image>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="details">
					<view>安全交底人：</view>
					<view class="right">{{detail.safeDiscloseUser}}</view>
				</view>
				<view class="details">
					<view>接受交底人：</view>
					<view class="right">{{detail.acceptDiscloseUser}}</view>
				</view>
				<view class="details area">
					<view>
						安全交底附件：
						<view class="image" >
							<view v-for="(item,index) in detail.fileList" :key="index" style="display: flex;">
								<image :src="item.url"></image>
							</view>
							
						</view>
					</view>
				</view>
				<view class="details area">
					<view>
						作业方案、应急预案：
						<view class="image">
							<view v-for="(item,index) in detail.safeFileList" :key="index" style="display: flex;">
								<image :src="item.url"></image>
							</view>
							
						</view>
					</view>
				</view>
				<view class="details">
					<view>动火措施初审人：</view>
					<view class="right">{{detail.firstTrialUser}}</view>
				</view>
				<view class="details">
					<view>监护人：</view>
					<view class="right">{{detail.guardUser}}</view>
				</view>
				
			</view>
			<view class="footer">
				<button @tap="falses()">拒绝</button>
				<button @tap="trues()">同意</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				array:['请选择','1778881','22222','3333'],
				index:0,
				applyId:'',
				detail:[
					// hotAnalysisList:''
				],
				mast:[],
				current:""
			}
		},
		mounted() {
			this.getdetail()
		},
		onLoad(e){
			console.log(e)
			this.applyId=e.applyId
				console.log(this.applyId)
		},
		methods: {
			getdetail() {
				uni.request({
					url: this.$url + 'hot/apply/detail',
					traditional:true,
					header:{
						'Authorization': 'Bearer ' +  uni.getStorageSync("token")
					},
					data: {
						id:this.applyId
					},
					success: (res) => {
						console.log('nnjnnnjknjknik',res)
						this.detail= res.data;
						this.current=res.data.currentApprovalVo.approvalId;
						this.remark=res.data.currentApprovalVo.remark;
						console.log(res.data.currentApprovalVo)
						this.mast=res.data.measureList[0]
						console.log(res.data.measureList[0])
					}
				})
			},
			falses(){
				uni.request({
					url: this.$url + 'apply/approval',
					traditional:true,
					header:{
						'Authorization': 'Bearer ' +  uni.getStorageSync("token")
					},
					method:'POST',
					data: {
						approvalId:this.current,
						isPass:false,
						remark:this.remark
					},
					success: (res) => {
						console.log('nnjnnnjknjknik',res)
						
					}
				})
			},
			trues(){
				uni.request({
					url: this.$url + 'apply/approval',
					traditional:true,
					header:{
						'Authorization': 'Bearer ' +  uni.getStorageSync("token")
					},
					method:'POST',
					data: {
						isPass:true,
						approvalId:this.current,
						remark:this.remark
					},
					success: (res) => {
						console.log('nnjnnnjknjknik',res)
						
					}
				})
			},
			because: function(e) {
			 this.index = e.target.value
			 this.jgp=this.array[this.index] 
			},
		}
	}
</script>

<style>
.details{
	display: flex;flex-direction: row;justify-content: space-between;
	margin: 0 20rpx;
	line-height: 60rpx;font-size: 30rpx;
}
.details .right{color: #666666;font-size: 26rpx;}
/* .details textarea{width: 100%!important;height: 100rpx;} */
.textarea{font-size: 26rpx;color: #666666;line-height: 44rpx;}
.area{margin-bottom:5rpx;}
.area view{width: 100%;}
.shuju{border-top: 10rpx solid #EEEEEE;}
.image{display: flex;flex-direction: row;}
.image view{width: 186rpx;height: 186rpx;}
.image image{width: 186rpx;height: 186rpx;border-radius: 6rpx;margin-right: 10rpx;}
.details text{color: #999999;font-size: 24rpx;}
.xian{color: #666666;font-size: 26rpx;line-height: 40rpx;margin: 10rpx 0;}
.xian .dian{color: #3472FD;}
.footer{background-color:#F2F2F2;display: flex;flex-direction: row;justify-content: space-between;margin-top: 30rpx;}
.footer button{margin:60rpx 20rpx;font-size: 36rpx;color: #FFFFFF;}
.footer button:first-child{width: 330rpx;height: 88rpx;background: #FFA256;border-radius: 44rpx;}
.footer button:last-child{width: 330rpx;height: 88rpx;background: #3472FD;border-radius: 44rpx;}
.safeWord{font-size: 16px;color: #000000;}
</style>